<%@ page import="com.lbs.demo.entities.SongsEntity" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<!-- /.box-header -->
<div class="box-body no-padding">
    <table class="table table-striped">
        <tr>
            <th style="width: 10px">#</th>
            <th>歌曲名称</th>
            <th>歌手</th>
            <th>时长</th>
        </tr>

        <%
            List<SongsEntity> list = (List<SongsEntity>) request.getAttribute("musicList");
            for (int i = 0; i < list.size(); i++) {
        %>
        <tr>
            <td><%=(i + 1)%>
            </td>
            <td>
                <a href="http://music.163.com/song?id=<%=list.get(i).getSongId()%>" target="_blank">
                    <i class="fa fa-play-circle"></i> &nbsp; <%=list.get(i).getName()%>
                </a>
            </td>
            <td><%=list.get(i).getSinger()%>
            <td><%
                int t = list.get(i).getDuration() / 1000;
                int mm = t / 60;
                int ss = t % 60;
                out.print(String.format("%02d", mm) + ":" + String.format("%02d", ss));
            %></td>
            </td>
        </tr>

        <%
            }
        %>

    </table>
</div>

